package com.xbongbong.saas.factory.business;

import com.xbongbong.saas.service.recheck.abstracts.RecheckSearchStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 重复规则工厂模型
 *
 * @throws
 * @return
 * @author lijiangren
 * @date 2022-11-15 10 53
 * @since
 * @version
 */
@Component
public class RecheckSearchFactory {

    private static final Logger LOG = LoggerFactory.getLogger(RecheckSearchFactory.class);


    @Resource
    private Map<Integer, RecheckSearchStrategy>  recheckSearchStrategyMap;
    /**
    * 通过map获取策略，当增加新的策略时无需修改代码，对修改封闭，对扩展开放，遵循开闭原则
     */
    public  RecheckSearchStrategy getRecheckSearchStrategy(Integer businessType)  {
       return recheckSearchStrategyMap.get(businessType);
    }

}
